<?php
/**
 * Copyright (c) [2019] [吴跃忠]
 * [selibra] is licensed under the Mulan PSL v1.
 * You can use this software according to the terms and conditions of the Mulan PSL v1.
 * You may obtain a copy of Mulan PSL v1 at:
 * http://license.coscl.org.cn/MulanPSL
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
 * See the Mulan PSL v1 for more details.
 */

namespace LeoMQ;


use LeoMQ\Intf\MQSubscriber;

class SimpleMQSubscriber implements MQSubscriber
{

    public function __construct(
        public string $queue,
        public ?string $consumerTag = null,
        public ?string $consumerClass = null,
        public ?string $consumerMethod = null
    )
    {

    }

    /**
     * 获取队列名称
     * @return string
     */
    public function queue(): string
    {
        return $this->queue;
    }

    /**
     * @return string
     */
    public function consumerTag(): ?string
    {
        return $this->consumerTag?:'';
    }


    /**
     * 获取消费者对象
     * @return string
     */
    public function consumerClass(): string
    {
        return $this->consumerClass;
    }

    /**
     * 获取消费者方法
     * @return string
     */
    public function consumerMethod(): string
    {
        return $this->consumerMethod;
    }
}